//
//  xianXiaHuoDongViewController.m
//  YuErmuYing
//
//  Created by Tiancheng on 16/9/14.
//  Copyright © 2016年 Tiancheng. All rights reserved.
//

#import "xianXiaHuoDongViewController.h"
#import "UIParameter.h"
#import "NinaPagerView.h"

@interface xianXiaHuoDongViewController ()
@property (weak, nonatomic) IBOutlet UIView *headerView;
@property (weak, nonatomic) IBOutlet UIView *headerView01;

@end

@implementation xianXiaHuoDongViewController
-(void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBarHidden=YES;
    self.tabBarController.tabBar.hidden=YES;
    
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    //设置背景色
    [self setBackGroundColor];
    //不往下偏移
    self.automaticallyAdjustsScrollViewInsets=NO;
    NSArray *titleArray = [self ninaTitleArray];
    NSArray *vcsArray = [self ninaVCsArray];
    NSArray *colorArray = [self ninaColorArray];
    NinaPagerView *ninaPagerView = [[NinaPagerView alloc] initWithNinaPagerStyle:NinaPagerStyleBottomLine WithTitles:titleArray WithVCs:vcsArray WithColorArrays:colorArray];
    ninaPagerView.titleScale = 1.15;
    [self.view addSubview:ninaPagerView];
    //如果您需要将导航栏隐藏，您可以对此参数
    ninaPagerView.pushEnabled = YES;

    
}
//设置背景色
-(void)setBackGroundColor
{
    self.headerView.backgroundColor=[UIColor colorWithRed:244/255.0 green:142/255.0 blue:177/255.0 alpha:1];
    self.headerView01.backgroundColor=[UIColor colorWithRed:240/255.0 green:98/255.0 blue:146/255.0 alpha:1];
}
#pragma mark - NinaPagerViewDelegate
//如果您觉得创建的控制器(0.7:只适用于控制器情况)过多(>5)占用内存过大，可以尝试此代理方法，默认只保留5个最近滑到的控制器，剩下的控制器将被释放，直到您再滑到相应位置才会被重新加载，如果不执行此代理，则默认为不释放。
- (BOOL)deallocVCsIfUnnecessary
{
    return YES;
}
//通过此代理方法您可以获取到当前页码进而对相关的控制器进行操作。
- (void)ninaCurrentPageIndex:(NSString *)currentPage
{
    NSLog(@"Current page is %@",currentPage);
}
#pragma mark - NinaParaArrays
- (NSArray *)ninaColorArray
{
    return @[
             [UIColor colorWithRed:233/255.0 green:30/255.0 blue:99/255.0 alpha:1.0], /**< 选中的标题颜色 Title SelectColor  **/
             [UIColor colorWithRed:233/255.0 green:30/255.0 blue:99/255.0 alpha:1.0], /**< 未选中的标题颜色  Title UnselectColor **/
             [UIColor colorWithRed:233/255.0 green:30/255.0 blue:99/255.0 alpha:1.0], /**< 下划线颜色或滑块颜色 Underline or SlideBlock Color   **/
             [UIColor whiteColor], /**<  上方菜单栏的背景颜色 TopTab Background Color   **/
             ];
}
- (NSArray *)ninaTitleArray {
    return @[
             @"全部",
             @"婴儿游泳",
             @"宝贝照",
             @"孕妇照",
             @"早教",
             @"产后恢复",
             @"小儿推拿",
             ];
}
- (NSArray *)ninaVCsArray {
    return @[
             @"allActivityViewController",
             @"yingErSwimViewController",
             @"BaoBeiPhotoViewController",
             @"yunFuPhotoViewController",
             @"zaoJiaoViewController",
             @"chanHouHuiFuViewController",
             @"xiaoErTuiNaViewController"
             ];
}




- (IBAction)goBack:(id)sender
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
